package com.inss.trial;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ComboBox;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedMap;

public class HomeController {
    @FXML
    private ComboBox<Pair> comboBox;
    @FXML
    private ChoiceBox<String> charset;

    @FXML
    private Button getXML;

    public void initialize() {
        List<Pair> options = new ArrayList<>() {{
            add(new Pair("投保试算", "QT0001"));
            add(new Pair("实时承保", "QT0002"));
            add(new Pair("当日撤单", "QT0003"));
        }};
        // 添加选项到ComboBox
        comboBox.getItems().addAll(options);
        // 设置默认值
        comboBox.setValue(options.get(0));

        getXML.setOnAction(e -> {
            System.out.println(comboBox.getValue().getValue());
            System.out.println(charset.getValue());
        });
    }
}